home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Super Platinum 8
/
Shareware Super Platinum 8.iso
/
mac
/
PROGTOOL
/
NETPROG.ZIP;1
/
NETPROG.TAR
/
ipc
/
getpwd.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1989-12-17
|
299 b
|
21 lines
#include <stdio.h>
#define MAXLINE 255
main()
{
FILE *fp;
char line[MAXLINE];
if ( (fp = popen("/bin/pwd", "r")) == NULL)
err_sys("popen error");
if (fgets(line, MAXLINE, fp) == NULL)
err_sys("fgets error");
printf("%s", line); /* pwd inserts the newline */
pclose(fp);
exit(0);
}